#ifndef __D3D_RENDER_H__
#define __D3D_RENDER_H__
#include "irender.h"
#include "d3d9.h"

class D3DRender :
	public IRender
{
private:
	D3DPRESENT_PARAMETERS m_d3dpp;
	CComPtr<IDirect3D9>  m_pD3d9;
	CComPtr<IDirect3DDevice9> m_pD3dDevice;
	CComPtr<IDirect3DSurface9>m_pD3dSurfaceRGBA;
	//CComPtr<IDirect3DSurface9>m_pD3dSurfaceRGBARotate;

	CComPtr<IDirect3DSurface9>m_pD3dSurfaceYUV;
	//CComPtr<IDirect3DSurface9>m_pD3dSurfaceYUVRotate;

	void renderRgb(HWND , AVFrame* );
	void renderYuv(HWND, AVFrame*);
	void renderCommon(HWND, IDirect3DSurface9*);
public:
	D3DRender();
	virtual void init();
	virtual ~D3DRender();
	virtual void wtl_show(HWND, AVFrame*);
	virtual string GetName();
};
#endif
